<?php

if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
$mydirname = basename( dirname( __FILE__ ) ) ;

$modversion['name'] = _MI_JOBS_NAME;
$modversion['version'] = '2.42';
$modversion['description'] = _MI_JOBS_DESC;
$modversion['credits'] = "Jobs Module for Xoops by John Mordo Created from Myads jp 2.04";
$modversion['author'] = "Sebastian Jaramillo - Tecnologo en Sistemas PMFS";
$modversion['license'] = "GPL";
$modversion['official'] = 0;
$modversion['image'] = "images/jobs_slogo.gif";
$modversion['dirname'] = $mydirname;

// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu'] = "admin/menu.php";

// Templates
$modversion['templates'][1]['file'] = 'jobs_index.html';
$modversion['templates'][1]['description'] = '';
$modversion['templates'][2]['file'] = 'jobs_adlist.html';
$modversion['templates'][2]['description'] = '';
$modversion['templates'][3]['file'] = 'jobs_category.html';
$modversion['templates'][3]['description'] = '';
$modversion['templates'][4]['file'] = 'jobs_item.html';
$modversion['templates'][4]['description'] = '';
$modversion['templates'][5]['file'] = 'jobs_res_adlist.html';
$modversion['templates'][5]['description'] = '';
$modversion['templates'][6]['file'] = 'jobs_index2.html';
$modversion['templates'][6]['description'] = '';
$modversion['templates'][7]['file'] = 'jobs_res_category.html';
$modversion['templates'][7]['description'] = '';
$modversion['templates'][8]['file'] = 'jobs_resume.html';
$modversion['templates'][8]['description'] = '';
$modversion['templates'][9]['file'] = 'jobs_index_empresas.html';
$modversion['templates'][9]['description'] = '';
$modversion['templates'][10]['file'] = 'jobs_empresas.html';
$modversion['templates'][10]['description'] = '';
$modversion['templates'][11]['file'] = 'jobs_infoempresas.html';
$modversion['templates'][11]['description'] = '';
$modversion['templates'][12]['file'] = 'jobs_index_vinculados.html';
$modversion['templates'][12]['description'] = '';
$modversion['templates'][13]['file'] = 'jobs_vinculados.html';
$modversion['templates'][13]['description'] = '';
$modversion['templates'][14]['file'] = 'jobs_view_empresas.html';
$modversion['templates'][14]['description'] = '';
$modversion['templates'][15]['file'] = 'jobs_view_reportes.html';
$modversion['templates'][15]['description'] = '';
$modversion['templates'][16]['file'] = 'jobs_principalempresas.html';
$modversion['templates'][16]['description'] = '';
$modversion['templates'][17]['file'] = 'jobs_inicio.html';
$modversion['templates'][17]['description'] = '';
$modversion['templates'][18]['file'] = 'jobs_resumelisting.html';
$modversion['templates'][18]['description'] = '';


// Blocks
$modversion['blocks'][1]['file'] = "jobs.php";
$modversion['blocks'][1]['name'] = _MI_JOBS_BNAME;
$modversion['blocks'][1]['description'] = _MI_JOBS_BNAME_DESC;
$modversion['blocks'][1]['show_func'] = "jobs_show";
$modversion['blocks'][1]['template'] = "jobs_block_new.html";
//$modversion['blocks'][1]['can_clone'] = "true" ;
//$modversion['blocks'][1]['options'] = "{$mydirname}";

// Menu
$modversion['hasMain'] = 1;

// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
// All tables should not have any prefix!
$modversion['sqlfile']['mysql'] = "sql/mysql.sql";

// Tables created by sql file (without prefix!)
$modversion['tables'][0] = "jobs_listing";
$modversion['tables'][1] = "jobs_categories";
$modversion['tables'][2] = "jobs_empresas";
$modversion['tables'][3] = "jobs_price";
$modversion['tables'][4] = "jobs_resume";
$modversion['tables'][5] = "jobs_res_categories";
$modversion['tables'][6] = "jobs_envios";
$modversion['tables'][7] = "jobs_vinculados";

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = "jobs_search";

// Config Settings
$modversion['hasconfig'] = 1;

// $xoopsModuleConfig['ynprice']
$modversion['config'][1] = array(
'name' => 'monnaie' ,
'title' => '_MI_JOBS_MONEY' ,
'description' => '' ,
'formtype' => 'textbox' ,
'valuetype' => 'text' ,
'default' => '$' ,
'options' => array()
) ;

 //$xoopsModuleConfig['koivi']
$modversion['config'][] = array(
'name' => 'koivi' ,
'title' => '_MI_JOBS_KOIVI' ,
'description' => '' ,
'formtype' => 'yesno' ,
'valuetype' => 'int' ,
'default' => '0' ,
'options' => array()
) ;

 //$xoopsModuleConfig['moderated']
$modversion['config'][] = array(
'name' => 'moderated' ,
'title' => '_MI_JOBS_MODERAT' ,
'description' => '' ,
'formtype' => 'yesno' ,
'valuetype' => 'int' ,
'default' => '0' ,
'options' => array()
) ;

 //$xoopsModuleConfig['moderated']
$modversion['config'][] = array(
'name' => 'moderate_resume' ,
'title' => '_MI_JOBS_RES_MODERAT' ,
'description' => '' ,
'formtype' => 'yesno' ,
'valuetype' => 'int' ,
'default' => '0' ,
'options' => array()
) ;

// $xoopsModuleConfig['affichage']
$modversion['config'][] = array(
'name' => 'nb_affichage' ,
'title' => '_MI_JOBS_PERPAGE' ,
'description' => '' ,
'formtype' => 'select' ,
'valuetype' => 'int' ,
'default' => '10' ,
'options' => array('10'=>10, '15'=>15, '20'=>20, '25'=>25, '30'=>30, '35'=>35, '40'=>40, '50'=>50)
) ;

// $xoopsModuleConfig['affichage']
$modversion['config'][] = array(
'name' => 'resume_perpage' ,
'title' => '_MI_JOBS_RES_PERPAGE' ,
'description' => '' ,
'formtype' => 'select' ,
'valuetype' => 'int' ,
'default' => '10' ,
'options' => array('10'=>10, '15'=>15, '20'=>20, '25'=>25, '30'=>30, '35'=>35, '40'=>40, '50'=>50)
) ;

// $xoopsModuleConfig['newann']
$modversion['config'][] = array(
'name' => 'newann' ,
'title' => '_MI_JOBS_VIEWNEWCLASS' ,
'description' => '_MI_JOBS_ONHOME' ,
'formtype' => 'yesno' ,
'valuetype' => 'int' ,
'default' => '1' ,
'options' => array()
) ;

// $xoopsModuleConfig['newclassifieds']
$modversion['config'][] = array(
'name' => 'newclassifieds' ,
'title' => '_MI_JOBS_NUMNEW' ,
'description' => '_MI_JOBS_ONHOME' ,
//	'formtype' => 'select' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '10' ,
//	'options' => array('5'=>5, '10'=>10, '15'=>15, '20'=>20, '25'=>25, '30'=>30, '35'=>35, '40'=>40, '50'=>50)
'options' => array()
) ;

// $xoopsModuleConfig['countday']
$modversion['config'][] = array(
'name' => 'countday' ,
'title' => '_MI_JOBS_NEWTIME' ,
'description' => '_MI_JOBS_INDAYS' ,
//	'formtype' => 'select' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '3' ,
//	'options' => array('1'=>1, '2'=>2, '3'=>3, '4'=>4, '5'=>5, '6'=>6, '7'=>7, '8'=>8, '9'=>9, '10'=>10, '20'=>20, '30'=>30, '40'=>40, '50'=>50)
'options' => array()
) ;

// $xoopsModuleConfig['photomax']
$modversion['config'][] = array(
'name' => 'resumesize' ,
'title' => '_MI_JOBS_RES_SIZE' ,
'description' => '_MI_JOBS_INBYTES' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '10000' ,
'options' => array()
) ;

// $xoopsModuleConfig['photomax']
$modversion['config'][] = array(
'name' => 'photomax' ,
'title' => '_MI_JOBS_MAXIIMGS' ,
'description' => '_MI_JOBS_INBYTES' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '30000' ,
'options' => array()
) ;

// $xoopsModuleConfig['maxwide']
$modversion['config'][] = array(
'name' => 'maxwide' ,
'title' => '_MI_JOBS_MAXWIDE' ,
'description' => '_MI_JOBS_INPIXEL' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '500' ,
'options' => array()
) ;

// $xoopsModuleConfig['maxhigh']
$modversion['config'][] = array(
'name' => 'maxhigh' ,
'title' => '_MI_JOBS_MAXHIGH' ,
'description' => '_MI_JOBS_INPIXEL' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '400' ,
'options' => array()
) ;

// $xoopsModuleConfig['claday']
$modversion['config'][] = array(
'name' => 'jobsdays' ,
'title' => '_MI_JOBS_DAYS' ,
'description' => '_MI_JOBS_INDAYS' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '14' ,
'options' => array()
) ;

// $xoopsModuleConfig['claday']
$modversion['config'][] = array(
'name' => 'resdays' ,
'title' => '_MI_JOBS_RES_DAYS' ,
'description' => '_MI_JOBS_INDAYS' ,
'formtype' => 'textbox' ,
'valuetype' => 'int' ,
'default' => '180' ,
'options' => array()
) ;

// $xoopsModuleConfig['affichebloc']
$modversion['config'][] = array(
'name' => 'affichebloc' ,
'title' => '_MI_JOBS_TYPEBLOC' ,
'description' => '' ,
'formtype' => 'select' ,
'valuetype' => 'text' ,
'default' => '1' ,
'options' => array('_MI_JOBS_LASTTEN'=>'1', '_MI_JOBS_JOBRAND'=>'2')
) ;

// $xoopsModuleConfig['souscat']
$modversion['config'][] = array(
'name' => 'souscat',
'title' => '_MI_JOBS_DISPLSUBCAT',
'description' => '_MI_JOBS_ONHOME',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => '1',
'options' => array()
) ;

// $xoopsModuleConfig['nbsouscat']
$modversion['config'][] = array(
'name' => 'nbsouscat',
'title' => '_MI_JOBS_NBDISPLSUBCAT',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => '4',
'options' => array()
) ;

// $xoopsModuleConfig['classm']
$modversion['config'][] = array(
'name' => 'classm',
'title' => '_MI_JOBS_ORDRECLASS',
'description' => '',
'formtype' => 'select',
'valuetype' => 'text',
'default' => 'title',
'options' => array('_MI_JOBS_ORDREALPHA'=>'title', '_MI_JOBS_ORDREPERSO'=>'ordre' )
) ;

//Notification
$modversion['hasNotification'] = 1;

$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
$modversion['notification']['lookup_func'] = 'jobs_notify_iteminfo';

//category
$modversion['notification']['category'][1]['name'] = 'category';
$modversion['notification']['category'][1]['title'] = _MI_JOBS_CATEGORY_NOTIFY;
$modversion['notification']['category'][1]['description'] = _MI_JOBS_CATEGORY_NOTIFYDSC;
$modversion['notification']['category'][1]['subscribe_from'] = 'index.php';
$modversion['notification']['category'][1]['item_name'] = 'cid';
$modversion['notification']['category'][1]['allow_bookmark'] = 0;
$modversion['notification']['category'][1]['extraParams'] = array('pa');

$modversion['notification']['category'][2]['name'] = 'listing';
$modversion['notification']['category'][2]['title'] = _MI_JOBS_NOTIFY;
$modversion['notification']['category'][2]['description'] = _MI_JOBS_NOTIFYDSC;
$modversion['notification']['category'][2]['subscribe_from'] = 'index.php';
$modversion['notification']['category'][2]['item_name'] = 'lid';
$modversion['notification']['category'][2]['allow_bookmark'] = 0;
$modversion['notification']['category'][2]['extraParams'] = array('pa');

$modversion['notification']['category'][3]['name'] = 'global';
$modversion['notification']['category'][3]['title'] = _MI_JOBS_GLOBAL_NOTIFY;
$modversion['notification']['category'][3]['description'] = _MI_JOBS_GLOBAL_NOTIFYDSC;
$modversion['notification']['category'][3]['subscribe_from'] = 'index.php';
$modversion['notification']['category'][3]['extraParams'] = array('pa');

//event
//jobs notifications new listings in this category
$modversion['notification']['event'][1]['name'] = 'new_listing';
$modversion['notification']['event'][1]['category'] = 'category';
$modversion['notification']['event'][1]['title'] = _MI_JOBS_NEWPOST_NOTIFY;
$modversion['notification']['event'][1]['caption'] = _MI_JOBS_NEWPOST_NOTIFYCAP;
$modversion['notification']['event'][1]['description'] = _MI_JOBS_NEWPOST_NOTIFYDSC;
$modversion['notification']['event'][1]['mail_template'] = 'listing_newpost_notify';
$modversion['notification']['event'][1]['mail_subject'] = _MI_JOBS_NEWPOST_NOTIFYSBJ;
 
//new listings in all categories posted
$modversion['notification']['event'][2]['name'] = 'new_listing';
$modversion['notification']['event'][2]['category'] = 'global';
$modversion['notification']['event'][2]['title'] = _MI_JOBS_GLOBAL_NEWPOST_NOTIFY;
$modversion['notification']['event'][2]['caption'] = _MI_JOBS_GLOBAL_NEWPOST_NOTIFYCAP;
$modversion['notification']['event'][2]['description'] = _MI_JOBS_GLOBAL_NEWPOST_NOTIFYDSC;
$modversion['notification']['event'][2]['mail_template'] = 'listing_newpost_notify';
$modversion['notification']['event'][2]['mail_subject'] = _MI_JOBS_GLOBAL_NEWPOST_NOTIFYSBJ;


// On Update
if( ! empty( $_POST['fct'] ) && ! empty( $_POST['op'] ) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname'] ) {
	include dirname( __FILE__ ) . "/include/onupdate.inc.php" ;
}

?>
